Support gh and hf CLIs in agent sandboxes#177
Open
akseljoonas wants to merge 1 commit intomainfrom
Open
Conversation
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
The sandbox already exposes bash as the escape hatch for live repository and Hub operations, so this change teaches the model when to use gh/hf there and installs the CLIs in the generated sandbox image. GitHub credentials stay user-owned: HF_TOKEN is injected from the user's HF session, while GH_TOKEN/GITHUB_TOKEN are only added when the user explicitly supplies a GitHub token to sandbox_create. Constraint: Issue #167 reports that models cannot access GitHub reliably through the current guidance. Rejected: Reusing a server or maintainer GitHub token | GitHub access must be scoped to the user's own account. Confidence: high Scope-risk: narrow Directive: Do not broaden GitHub token propagation without a user-owned auth path. Tested: UV_CACHE_DIR=/tmp/uv-cache uv run --extra dev pytest tests/unit/test_sandbox_cli_support.py tests/unit/test_sandbox_api_auth.py tests/unit/test_sandbox_already_active_message.py Tested: Live cpu-basic sandbox akseljoonas/ml-intern-cli-live-f54f2f70 verified gh path/version, hf path/version, hf auth whoami, HF_TOKEN present, then deleted. Not-tested: Authenticated GitHub CLI operations inside a sandbox with a real user GitHub token; no user GitHub token was supplied for live testing.
485a702 to
310bce1
Compare
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
closed per maintainer request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gh/hfthrough bash in sandbox and local CLI modesFixes #167.
Tests
UV_CACHE_DIR=/tmp/uv-cache uv run --extra dev pytest tests/unit/test_sandbox_cli_support.py tests/unit/test_sandbox_api_auth.py tests/unit/test_sandbox_already_active_message.pyakseljoonas/ml-intern-cli-live-f54f2f70: verifiedghpath/version,hfpath/version,hf auth whoami,HF_TOKENpresent; deleted after testNot tested